{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# 更多示例应用\n",
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "import random\n",
    "import string\n",
    "import tushare as ts # Yahoo的接口不能指望了\n",
    "from pandas import DataFrame, Series\n",
    "from pandas.tseries.offsets import Day, Hour, Minute, MonthEnd\n",
    "from sklearn.linear_model import LinearRegression\n",
    "\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>180etf</th>\n",
       "      <th>500etf</th>\n",
       "      <th>50etf</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2015-01-05</th>\n",
       "      <td>3.298</td>\n",
       "      <td>1.513</td>\n",
       "      <td>2.622</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-06</th>\n",
       "      <td>3.274</td>\n",
       "      <td>1.536</td>\n",
       "      <td>2.592</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-07</th>\n",
       "      <td>3.280</td>\n",
       "      <td>1.537</td>\n",
       "      <td>2.588</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-08</th>\n",
       "      <td>3.197</td>\n",
       "      <td>1.523</td>\n",
       "      <td>2.518</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-09</th>\n",
       "      <td>3.198</td>\n",
       "      <td>1.515</td>\n",
       "      <td>2.524</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-12</th>\n",
       "      <td>3.167</td>\n",
       "      <td>1.493</td>\n",
       "      <td>2.500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-13</th>\n",
       "      <td>3.152</td>\n",
       "      <td>1.514</td>\n",
       "      <td>2.485</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-14</th>\n",
       "      <td>3.153</td>\n",
       "      <td>1.508</td>\n",
       "      <td>2.494</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-15</th>\n",
       "      <td>3.260</td>\n",
       "      <td>1.533</td>\n",
       "      <td>2.586</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-16</th>\n",
       "      <td>3.292</td>\n",
       "      <td>1.547</td>\n",
       "      <td>2.604</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            180etf  500etf  50etf\n",
       "date                             \n",
       "2015-01-05   3.298   1.513  2.622\n",
       "2015-01-06   3.274   1.536  2.592\n",
       "2015-01-07   3.280   1.537  2.588\n",
       "2015-01-08   3.197   1.523  2.518\n",
       "2015-01-09   3.198   1.515  2.524\n",
       "2015-01-12   3.167   1.493  2.500\n",
       "2015-01-13   3.152   1.514  2.485\n",
       "2015-01-14   3.153   1.508  2.494\n",
       "2015-01-15   3.260   1.533  2.586\n",
       "2015-01-16   3.292   1.547  2.604"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_50 = ts.get_hist_data('510050',start='2015-01-01',end='2016-12-31')\n",
    "data_180 = ts.get_hist_data('510180',start='2015-01-01',end='2016-12-31')\n",
    "data_500 = ts.get_hist_data('510500',start='2015-01-01',end='2016-12-31')\n",
    "data_50.index = pd.to_datetime(data_50.index)\n",
    "data_180.index = pd.to_datetime(data_180.index)\n",
    "data_500.index = pd.to_datetime(data_500.index)\n",
    "data_50 = data_50[::-1]\n",
    "data_180 = data_180[::-1]\n",
    "data_500 = data_500[::-1]\n",
    "data = DataFrame({'50etf': data_50['close'],\n",
    "                  '180etf': data_180['close'],\n",
    "                  '500etf': data_500['close']})\n",
    "data[:10]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>180etf</th>\n",
       "      <th>500etf</th>\n",
       "      <th>50etf</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2015-01-05</th>\n",
       "      <td>3.298</td>\n",
       "      <td>1.513</td>\n",
       "      <td>2.622</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-06</th>\n",
       "      <td>3.274</td>\n",
       "      <td>1.536</td>\n",
       "      <td>2.592</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-07</th>\n",
       "      <td>3.280</td>\n",
       "      <td>1.537</td>\n",
       "      <td>2.588</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-08</th>\n",
       "      <td>3.197</td>\n",
       "      <td>1.523</td>\n",
       "      <td>2.518</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-09</th>\n",
       "      <td>3.198</td>\n",
       "      <td>1.515</td>\n",
       "      <td>2.524</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-12</th>\n",
       "      <td>3.167</td>\n",
       "      <td>1.493</td>\n",
       "      <td>2.500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-13</th>\n",
       "      <td>3.152</td>\n",
       "      <td>1.514</td>\n",
       "      <td>2.485</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-14</th>\n",
       "      <td>3.153</td>\n",
       "      <td>1.508</td>\n",
       "      <td>2.494</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-15</th>\n",
       "      <td>3.260</td>\n",
       "      <td>1.533</td>\n",
       "      <td>2.586</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-16</th>\n",
       "      <td>3.292</td>\n",
       "      <td>1.547</td>\n",
       "      <td>2.604</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            180etf  500etf  50etf\n",
       "date                             \n",
       "2015-01-05   3.298   1.513  2.622\n",
       "2015-01-06   3.274   1.536  2.592\n",
       "2015-01-07   3.280   1.537  2.588\n",
       "2015-01-08   3.197   1.523  2.518\n",
       "2015-01-09   3.198   1.515  2.524\n",
       "2015-01-12   3.167   1.493  2.500\n",
       "2015-01-13   3.152   1.514  2.485\n",
       "2015-01-14   3.153   1.508  2.494\n",
       "2015-01-15   3.260   1.533  2.586\n",
       "2015-01-16   3.292   1.547  2.604"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data = data.asfreq('B').fillna(method='pad')\n",
    "data[:10]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x1d5eb59f518>"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "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d5kn/+3Ng5d3c5kSoERrvdyz/QomkAsRcSRwi6imlFKYvPRGrfVf/B56C7jCc/8K\n4M2urqO13g/sUUqN8ew6FdgQ5OIKERTSq0RENaXULOBjYC3g9uz+FSbP/RIwGDNPxUWeOZjzgGIg\n1XN8AzDeM3fzZMy8FrGYGeV+oLWu7svXI0QgJHALIUSUkVSJEEJEGQncQggRZSRwCyFElJHALYQQ\nUUYCtxBCRBkJ3KLfUUrd1X7mv3aPn6eUGt+XZRIimCRwiyPReYAEbhG1pB+36BeUUr8GLgf2YCaL\nWgnUAtdiBtRsBb4PTAYWeh6rBS70XOJRIAdoBK7RWkfS4sJCtCGBW0Q9pdQ04J/ADMxkUauAx4Fn\ntNaVnmN+B5RprR9WSv0TWKi1fsXz2AfA9VrrLUqpGcAftNan9P0rESIwtnAXQIggOAF4XWvdCKCU\nesuzf6InYKcDycC77U/0zCp4HPCymfYEgLiQl1iIXpDALfqLjn46/hM4T2v9lVLqSmB2B8dYgBqt\n9eTQFU2I4JLGSdEffAScr5RK8Cxf9i3P/hSg1DPt62V+x9d7HsMzd/cOpdRFYGYbVEod3XdFF6Ln\nJMct+gW/xsldmLm1N2AWQ7jNs28tkKK1vlIpdTzwJNACfBszS+BjQD4QA7ygtb6nz1+EEAGSwC2E\nEFFGUiVCCBFlJHALIUSUkcAthBBRRgK3EEJEGQncQgjx/9upAxIAAAAAQf9ftyPQEc6IG2BG3AAz\nAUSWNSqjgkdCAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1d5eb59fb70>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "rets = data.pct_change()\n",
    "((1 + rets).cumprod() - 1).plot()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def calc_mom(price, lookback, lag): # 计算动量并归一化\n",
    "    mom_ret = price.shift(lag).pct_change(lookback)\n",
    "    ranks = mom_ret.rank(axis=1, ascending=False)\n",
    "    demeaned = ranks.sub(ranks.mean(axis=1), axis=0) # 不能直接做数学运算\n",
    "    return demeaned.div(demeaned.std(axis=1), axis=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "compound = lambda x : (1 + x).prod() - 1\n",
    "daily_sr = lambda x: x.mean() / x.std()\n",
    "\n",
    "# 通过指定回顾期和持有期（买卖之间的日数）计算投资组合整体的夏普比率。\n",
    "def strat_sr(prices, lb, hold):\n",
    "    freq = '%dB' % hold\n",
    "    port = calc_mom(prices, lb, lag=1)\n",
    "    daily_rets = prices.pct_change()\n",
    "    port = port.shift(1).resample(freq).first()\n",
    "    returns = daily_rets.resample(freq).apply(compound)\n",
    "    port_rets = (port * returns).sum(axis=1)\n",
    "    return daily_sr(port_rets) * np.sqrt(252 / hold)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-0.68843956159078112"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "strat_sr(data, 70, 30)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th>Lookback Period</th>\n",
       "      <th>20</th>\n",
       "      <th>25</th>\n",
       "      <th>30</th>\n",
       "      <th>35</th>\n",
       "      <th>40</th>\n",
       "      <th>45</th>\n",
       "      <th>50</th>\n",
       "      <th>55</th>\n",
       "      <th>60</th>\n",
       "      <th>65</th>\n",
       "      <th>70</th>\n",
       "      <th>75</th>\n",
       "      <th>80</th>\n",
       "      <th>85</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Holding Period</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>-0.650342</td>\n",
       "      <td>-0.705053</td>\n",
       "      <td>-0.642323</td>\n",
       "      <td>-0.696359</td>\n",
       "      <td>-0.690524</td>\n",
       "      <td>-0.706789</td>\n",
       "      <td>-0.738852</td>\n",
       "      <td>-0.705804</td>\n",
       "      <td>-0.691543</td>\n",
       "      <td>-0.729602</td>\n",
       "      <td>-0.678131</td>\n",
       "      <td>-0.656132</td>\n",
       "      <td>-0.087592</td>\n",
       "      <td>0.122036</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>-0.706789</td>\n",
       "      <td>-0.754015</td>\n",
       "      <td>-0.714925</td>\n",
       "      <td>-0.739271</td>\n",
       "      <td>-0.751783</td>\n",
       "      <td>-0.715316</td>\n",
       "      <td>-0.644989</td>\n",
       "      <td>-0.645164</td>\n",
       "      <td>-0.696519</td>\n",
       "      <td>-0.703536</td>\n",
       "      <td>-0.678927</td>\n",
       "      <td>0.216741</td>\n",
       "      <td>0.265430</td>\n",
       "      <td>-0.389036</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>-0.719082</td>\n",
       "      <td>-0.750235</td>\n",
       "      <td>-0.712541</td>\n",
       "      <td>-0.736701</td>\n",
       "      <td>-0.724463</td>\n",
       "      <td>-0.738933</td>\n",
       "      <td>-0.715397</td>\n",
       "      <td>-0.705367</td>\n",
       "      <td>-0.665197</td>\n",
       "      <td>-0.666865</td>\n",
       "      <td>-0.688440</td>\n",
       "      <td>-0.731093</td>\n",
       "      <td>-0.752234</td>\n",
       "      <td>-0.717710</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35</th>\n",
       "      <td>-0.710048</td>\n",
       "      <td>-0.685194</td>\n",
       "      <td>-0.693510</td>\n",
       "      <td>-0.660618</td>\n",
       "      <td>-0.705294</td>\n",
       "      <td>-0.642644</td>\n",
       "      <td>-0.630124</td>\n",
       "      <td>-0.639395</td>\n",
       "      <td>-0.626627</td>\n",
       "      <td>-0.634364</td>\n",
       "      <td>-0.589236</td>\n",
       "      <td>-0.609857</td>\n",
       "      <td>-0.642113</td>\n",
       "      <td>-0.685333</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40</th>\n",
       "      <td>-0.723227</td>\n",
       "      <td>-0.744054</td>\n",
       "      <td>-0.712806</td>\n",
       "      <td>-0.756273</td>\n",
       "      <td>-0.718757</td>\n",
       "      <td>-0.748103</td>\n",
       "      <td>-0.741096</td>\n",
       "      <td>-0.666046</td>\n",
       "      <td>-0.705966</td>\n",
       "      <td>-0.718442</td>\n",
       "      <td>-0.675990</td>\n",
       "      <td>-0.706424</td>\n",
       "      <td>-0.374236</td>\n",
       "      <td>-0.062298</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>45</th>\n",
       "      <td>-0.649198</td>\n",
       "      <td>-0.656881</td>\n",
       "      <td>-0.647025</td>\n",
       "      <td>-0.658119</td>\n",
       "      <td>-0.673608</td>\n",
       "      <td>-0.677257</td>\n",
       "      <td>-0.634468</td>\n",
       "      <td>-0.607247</td>\n",
       "      <td>-0.633378</td>\n",
       "      <td>-0.667799</td>\n",
       "      <td>-0.640540</td>\n",
       "      <td>-0.637064</td>\n",
       "      <td>-0.651411</td>\n",
       "      <td>-0.664170</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50</th>\n",
       "      <td>-0.676789</td>\n",
       "      <td>-0.740380</td>\n",
       "      <td>-0.687903</td>\n",
       "      <td>-0.699715</td>\n",
       "      <td>-0.692075</td>\n",
       "      <td>-0.712087</td>\n",
       "      <td>-0.647787</td>\n",
       "      <td>-0.641369</td>\n",
       "      <td>-0.689246</td>\n",
       "      <td>-0.685238</td>\n",
       "      <td>-0.633774</td>\n",
       "      <td>-0.628882</td>\n",
       "      <td>-0.628542</td>\n",
       "      <td>-0.639373</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>55</th>\n",
       "      <td>-0.681583</td>\n",
       "      <td>-0.683144</td>\n",
       "      <td>-0.683144</td>\n",
       "      <td>-0.702812</td>\n",
       "      <td>-0.696766</td>\n",
       "      <td>-0.728803</td>\n",
       "      <td>-0.729093</td>\n",
       "      <td>-0.649609</td>\n",
       "      <td>-0.647539</td>\n",
       "      <td>-0.654925</td>\n",
       "      <td>-0.656992</td>\n",
       "      <td>-0.654197</td>\n",
       "      <td>-0.651250</td>\n",
       "      <td>-0.649685</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>60</th>\n",
       "      <td>-0.688830</td>\n",
       "      <td>-0.698753</td>\n",
       "      <td>-0.689418</td>\n",
       "      <td>-0.695447</td>\n",
       "      <td>-0.737193</td>\n",
       "      <td>-0.742912</td>\n",
       "      <td>-0.707279</td>\n",
       "      <td>-0.702693</td>\n",
       "      <td>-0.641098</td>\n",
       "      <td>-0.647021</td>\n",
       "      <td>-0.647264</td>\n",
       "      <td>-0.662977</td>\n",
       "      <td>-0.661670</td>\n",
       "      <td>-0.682294</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>65</th>\n",
       "      <td>-0.811409</td>\n",
       "      <td>-0.764306</td>\n",
       "      <td>-0.718078</td>\n",
       "      <td>-0.721327</td>\n",
       "      <td>-0.737782</td>\n",
       "      <td>-0.733801</td>\n",
       "      <td>-0.757869</td>\n",
       "      <td>-0.852852</td>\n",
       "      <td>-0.851190</td>\n",
       "      <td>-0.635516</td>\n",
       "      <td>-0.634602</td>\n",
       "      <td>-0.609676</td>\n",
       "      <td>-0.618743</td>\n",
       "      <td>-0.619593</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>70</th>\n",
       "      <td>-0.730268</td>\n",
       "      <td>-0.715231</td>\n",
       "      <td>-0.734474</td>\n",
       "      <td>-0.718081</td>\n",
       "      <td>-0.745745</td>\n",
       "      <td>-0.759782</td>\n",
       "      <td>-0.791164</td>\n",
       "      <td>-0.810133</td>\n",
       "      <td>-0.797039</td>\n",
       "      <td>-0.805168</td>\n",
       "      <td>-0.631169</td>\n",
       "      <td>-0.655450</td>\n",
       "      <td>-0.664051</td>\n",
       "      <td>-0.704521</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75</th>\n",
       "      <td>-0.706582</td>\n",
       "      <td>-0.712394</td>\n",
       "      <td>-0.704275</td>\n",
       "      <td>-0.716051</td>\n",
       "      <td>-0.706749</td>\n",
       "      <td>-0.722604</td>\n",
       "      <td>-0.729679</td>\n",
       "      <td>-0.731526</td>\n",
       "      <td>-0.762230</td>\n",
       "      <td>-0.754814</td>\n",
       "      <td>-0.731605</td>\n",
       "      <td>-0.558498</td>\n",
       "      <td>-0.424199</td>\n",
       "      <td>-0.400811</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>80</th>\n",
       "      <td>-0.675027</td>\n",
       "      <td>-0.675390</td>\n",
       "      <td>-0.682628</td>\n",
       "      <td>-0.692333</td>\n",
       "      <td>-0.709637</td>\n",
       "      <td>-0.700012</td>\n",
       "      <td>-0.692213</td>\n",
       "      <td>-0.683003</td>\n",
       "      <td>-0.677392</td>\n",
       "      <td>-0.696484</td>\n",
       "      <td>-0.685230</td>\n",
       "      <td>-0.705220</td>\n",
       "      <td>-0.535160</td>\n",
       "      <td>-0.416496</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85</th>\n",
       "      <td>-0.686277</td>\n",
       "      <td>-0.696220</td>\n",
       "      <td>-0.690308</td>\n",
       "      <td>-0.671063</td>\n",
       "      <td>-0.669312</td>\n",
       "      <td>-0.659243</td>\n",
       "      <td>-0.659243</td>\n",
       "      <td>-0.659243</td>\n",
       "      <td>-0.654503</td>\n",
       "      <td>-0.653461</td>\n",
       "      <td>-0.648623</td>\n",
       "      <td>-0.676666</td>\n",
       "      <td>-0.657938</td>\n",
       "      <td>-0.184893</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "Lookback Period        20        25        30        35        40        45  \\\n",
       "Holding Period                                                                \n",
       "20              -0.650342 -0.705053 -0.642323 -0.696359 -0.690524 -0.706789   \n",
       "25              -0.706789 -0.754015 -0.714925 -0.739271 -0.751783 -0.715316   \n",
       "30              -0.719082 -0.750235 -0.712541 -0.736701 -0.724463 -0.738933   \n",
       "35              -0.710048 -0.685194 -0.693510 -0.660618 -0.705294 -0.642644   \n",
       "40              -0.723227 -0.744054 -0.712806 -0.756273 -0.718757 -0.748103   \n",
       "45              -0.649198 -0.656881 -0.647025 -0.658119 -0.673608 -0.677257   \n",
       "50              -0.676789 -0.740380 -0.687903 -0.699715 -0.692075 -0.712087   \n",
       "55              -0.681583 -0.683144 -0.683144 -0.702812 -0.696766 -0.728803   \n",
       "60              -0.688830 -0.698753 -0.689418 -0.695447 -0.737193 -0.742912   \n",
       "65              -0.811409 -0.764306 -0.718078 -0.721327 -0.737782 -0.733801   \n",
       "70              -0.730268 -0.715231 -0.734474 -0.718081 -0.745745 -0.759782   \n",
       "75              -0.706582 -0.712394 -0.704275 -0.716051 -0.706749 -0.722604   \n",
       "80              -0.675027 -0.675390 -0.682628 -0.692333 -0.709637 -0.700012   \n",
       "85              -0.686277 -0.696220 -0.690308 -0.671063 -0.669312 -0.659243   \n",
       "\n",
       "Lookback Period        50        55        60        65        70        75  \\\n",
       "Holding Period                                                                \n",
       "20              -0.738852 -0.705804 -0.691543 -0.729602 -0.678131 -0.656132   \n",
       "25              -0.644989 -0.645164 -0.696519 -0.703536 -0.678927  0.216741   \n",
       "30              -0.715397 -0.705367 -0.665197 -0.666865 -0.688440 -0.731093   \n",
       "35              -0.630124 -0.639395 -0.626627 -0.634364 -0.589236 -0.609857   \n",
       "40              -0.741096 -0.666046 -0.705966 -0.718442 -0.675990 -0.706424   \n",
       "45              -0.634468 -0.607247 -0.633378 -0.667799 -0.640540 -0.637064   \n",
       "50              -0.647787 -0.641369 -0.689246 -0.685238 -0.633774 -0.628882   \n",
       "55              -0.729093 -0.649609 -0.647539 -0.654925 -0.656992 -0.654197   \n",
       "60              -0.707279 -0.702693 -0.641098 -0.647021 -0.647264 -0.662977   \n",
       "65              -0.757869 -0.852852 -0.851190 -0.635516 -0.634602 -0.609676   \n",
       "70              -0.791164 -0.810133 -0.797039 -0.805168 -0.631169 -0.655450   \n",
       "75              -0.729679 -0.731526 -0.762230 -0.754814 -0.731605 -0.558498   \n",
       "80              -0.692213 -0.683003 -0.677392 -0.696484 -0.685230 -0.705220   \n",
       "85              -0.659243 -0.659243 -0.654503 -0.653461 -0.648623 -0.676666   \n",
       "\n",
       "Lookback Period        80        85  \n",
       "Holding Period                       \n",
       "20              -0.087592  0.122036  \n",
       "25               0.265430 -0.389036  \n",
       "30              -0.752234 -0.717710  \n",
       "35              -0.642113 -0.685333  \n",
       "40              -0.374236 -0.062298  \n",
       "45              -0.651411 -0.664170  \n",
       "50              -0.628542 -0.639373  \n",
       "55              -0.651250 -0.649685  \n",
       "60              -0.661670 -0.682294  \n",
       "65              -0.618743 -0.619593  \n",
       "70              -0.664051 -0.704521  \n",
       "75              -0.424199 -0.400811  \n",
       "80              -0.535160 -0.416496  \n",
       "85              -0.657938 -0.184893  "
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dd = {}\n",
    "lookbacks = range(20, 90, 5)\n",
    "holdings = range(20, 90, 5)\n",
    "for lb in lookbacks:\n",
    "    dd[lb] = {}\n",
    "    for hold in holdings:\n",
    "        dd[lb][hold] = strat_sr(data, lb, hold)\n",
    "ddf = DataFrame(dd)\n",
    "ddf.index.name = 'Holding Period'\n",
    "ddf.columns.name = 'Lookback Period'\n",
    "ddf"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def heatmap(df, cmap=plt.cm.gray_r):\n",
    "    fig = plt.figure()\n",
    "    ax = fig.add_subplot(111)\n",
    "    axim = ax.imshow(df.values, cmap=cmap, interpolation='nearest')\n",
    "    ax.set_xlabel(df.columns.name)\n",
    "    ax.set_xticks(np.arange(len(df.columns)))\n",
    "    ax.set_xticklabels(list(df.columns))\n",
    "    ax.set_ylabel(df.index.name)\n",
    "    ax.set_yticks(np.arange(len(df.index)))\n",
    "    ax.set_yticklabels(list(df.index))\n",
    "    plt.colorbar(axim)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAUQAAAEKCAYAAABquCzaAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4xLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvAOZPmwAAIABJREFUeJzt3Xu8XGV97/HPNzsXSLgkIQETolws\npVLEqJGCtKJcKmoLeIqKFYu3Rk6lyrFaQT0oWl8HrAq9WDRyrVpEUAQRBYzgOZ5TIwmJ3CmIXBJi\nINxzISE7v/PHegaGzczsNbNmrT0z+/t+vfZrz6xZv/U8e/bOL89aa57fo4jAzMxgwlh3wMysVzgh\nmpklTohmZokToplZ4oRoZpY4IZqZJU6IZmaJE6KZWeKEaGaWTBzrDuQxY8aMmDt3bsfxEyZ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FEbHaxwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1d5ed7bb160>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "heatmap(ddf) # 用热力图表示上面表格"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# 期货合约转仓\n",
    "# TODO：暂时没有数据，日后再说。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# 移动相关系数与线性回归"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "data_50 = ts.get_hist_data('510050',start='2016-01-01',end='2017-12-31')\n",
    "data_500 = ts.get_hist_data('510500',start='2016-01-01',end='2017-12-31')\n",
    "data_50.index = pd.to_datetime(data_50.index)\n",
    "data_500.index = pd.to_datetime(data_500.index)\n",
    "data_50 = data_50[::-1]\n",
    "data_500 = data_500[::-1]\n",
    "data_50_close = data_50['close']\n",
    "data_500_close = data_500['close']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x1d5ed7a89e8>"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX8AAAEICAYAAAC3Y/QeAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4xLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvAOZPmwAAIABJREFUeJzt3Xt8XHWd//HXJ/d7kzZpml7T0kJv\ntFxCBRFEKC6KAgooKAsoyu/nirj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JGNmdUskYhY5RyRi1rpKV18Xf3Dnc/6H8dk3sx\nsDt+/0PETt3+LbGRJ8/D66ZtVc6I5oRoZI1CxijlhGhljbpITO8Q3wtwoBpYGF+8n9jZprOB1zw+\nyZi7hzacSzmDF4WsUcgI0ckJ0coaVWm955+gF8gF9gBz4t/8/wT0uvtf+jaCNKCcwYtC1ihkhOjk\nhGhljaawDjYc743YiRq9wF+Am8LOo5zKGrWMUcoZtaxRvFn8Q057ZjYe+FvgG+5+MOw8R6KcwYtC\n1ihkhOjkhGhljaLIFH8REQlOVPr8RUQkQCr+IiIZSMVfRCQDqfiLiGQgFX8RkQyk4i9yBGb2RTP7\nP0d5/gozm5nKTCJBUfEXOXFXACr+Ekka5y+SwMw+B1wPbCU2odhyoBW4GcgjNsf83wKnEbuYfWv8\ndmX8Le4GqoAO4KPuvjaV+UUGS8VfJM7MzgTuB95EbNLD54HvA//t7k3xNl8Gdrr7t83sfuC37v6r\n+HOPAf/b3deb2ZuAr7r7hW9ck0j4IjGrp0iKnAf82mMXBcfM+maTnB0v+uXELhW4uP8LzawEeDPw\ny4QZhvOHPLHICVLxF3m9gX4K3w9c4e4rzexG4IIB2mQBLe5+2tBFEwmODviK/NUTwHvMrNDMSoF3\nx5eXAtvNLBf4YEL7/fHncPd9xC4cfjXELjBiZnNTF13k+KjPXyRBwgHfzUADsBpoB/4hvuwloNTd\nbzSzc4F7gYPAVcSmH/4eUENsLvqfu/udKf+PEBkEFX8RkQykbh8RkQyk4i8ikoFU/EVEMpCKv4hI\nBlLxFxHJQCr+IiIZSMVfRCQDqfiLiGSg/w/IAKJvLtC1PwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1d5ed6f2748>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "data_50_close.rolling(window=250).corr(data_500_close).plot()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "def rolling(x, y, index, window): # ols被pandas抛弃了\n",
    "    beta = []\n",
    "    lr = LinearRegression()\n",
    "    for start in range(1, len(x) - window):\n",
    "        end = start + window\n",
    "        x_ = DataFrame({'x': x[start:end]})\n",
    "        lr.fit(x_.as_matrix(), y[start:end].as_matrix())\n",
    "        beta.append(lr.coef_[0])\n",
    "    return Series(beta, index=index[1: len(index) - window])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "date\n",
       "2016-01-04         NaN\n",
       "2016-01-05    0.004386\n",
       "2016-01-06    0.013100\n",
       "2016-01-07   -0.064655\n",
       "2016-01-08    0.023041\n",
       "Name: close, dtype: float64"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_50_rets = data_50_close.pct_change()\n",
    "data_500_rets = data_500_close.pct_change()\n",
    "data_50_rets.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x1d5ed9085f8>"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAEICAYAAACktLTqAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4xLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvAOZPmwAAIABJREFUeJzt3Xd8W9X5+PHPI1ny3itOHMcZzk4Y\nCZkkpEDYu7SMAqFltPQLdNFBv5RS2gKF34sORllfSiktUCgjQErYJJAdQkI2zrYTx473Xjq/P65s\nnMSJZUfSleTn/XrpZeneKz3nSPJzj84991wxxqCUUiqyOOwugFJKKf/T5K6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YF1p5gAw0bun/BXgMcZ8YrwzrflRsOPZFVfrGVn11JiR\n9x0KXX7cc07DeoM/Aa4L9F4p2PG0npEVz864GjMy4oX6zW9nqIpILnA18KAxptkvLxpC8eyKq/WM\nvLgaMzLihTq/Tj+glFIqNITClZiUUkr5mSZ3pZSKQJrclVIqAmlyV0qpCKTJXSmlIpAmd9Vvichd\nInLbUdZfJCJjg1kmpfxFk7tSR3YRoMldhSUd5676FRH5X6xra+7BmmBqNVCNdd1MN1CIdSLM8VgX\nTq723r7ufYlHgEygAbjBGLM5mOVXylea3FW/ISKTgGeAqVhX7/kMeAz4mzGm3LvN74D9xpiHROQZ\n4E1jzMvede8D3zPGfCkiU7Gmlj01+DVRqmdRdhdAqSCaBbxqjGkAEJH53uXjvUk9BevyawsPfaKI\nJAAzgJe6zBgbHfASK9VHmtxVf9PdT9VngIuMMWtF5FpgTjfbOIAqY8zxgSuaUv6jB1RVf7IIuFhE\nYkUkEetCygCJwD4RcWFdyadDrXcdxpgaYIeIfAOsCz6IyHHBK7pSvaN97qpf6XJAdRdQBGwE6oGf\neZd9ASQaY64VkZlYF1BuBi7Fmk72r0AO1tzhLxhj7g56JZTygSZ3pZSKQNoto5RSEUiTu1JKRSBN\n7kopFYE0uSulVATS5K6UUhFIk7tSSkUgTe5KKRWBNLkrpVQE+v+uO2iZEWWOkAAAAABJRU5ErkJg\ngg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1d5ed92f4e0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "betas = rolling(data_50_rets, data_500_rets, data_50_rets.index, window=250)\n",
    "Series(betas).plot()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
